package a.a;

import a.c.bb;
import a.c.e;
import a.c.k;
import a.c.q;
import a.c.w;
import a.c.*;
import a.c.z;
import a.i.db;

public class b
{
  public static final byte a = 1;
  public static final byte b = 2;
  public static final byte c = 3;
  public static boolean d;
  
  public static bb[] a(q paramq, bb parambb)
  {
    x localx = db.a(new int[paramq.j()]);
    bb[] arrayOfbb = a(paramq, parambb, localx);
    return arrayOfbb;
  }
  
  public static bb[] a(q paramq, k paramk)
  {
    return a(paramq, new bb(paramq.v(), paramk));
  }
  
  public static bb[] a(q paramq, k paramk, x paramx)
  {
    return a(paramq, new bb(paramq.v(), paramk), paramx);
  }
  
  public static bb[] a(q paramq, bb parambb, x paramx)
  {
    return a(paramq, parambb, false, paramx);
  }
  
  public static bb[] a(q paramq, bb parambb, boolean paramBoolean, x paramx)
  {
    return a(paramq, parambb, paramBoolean, paramx, 0);
  }
  
  public static bb[] a(q paramq, bb parambb, boolean paramBoolean, x paramx, int paramInt)
  {
    if (m.b == 0) {}
    byte b1 = paramBoolean ? 2 : 3;
    return a(paramq, parambb, b1, paramx, paramInt);
  }
  
  public static bb[] a(q paramq, bb parambb, byte paramByte, x paramx, int paramInt)
  {
    int j = m.b;
    boolean bool = m.a;
    if (j == 0) {}
    switch (paramByte)
    {
    case 1: 
    case 2: 
    case 3: 
      if (!bool) {
        break;
      }
    default: 
      throw new IllegalArgumentException("Unsupported direction: " + paramByte);
    }
    z localz = new z();
    if ((j != 0) || (paramq.n())) {
      return new bb[0];
    }
    bb localbb = new bb();
    int i = 0;
    Object localObject1 = paramq.v();
    Object localObject2;
    do
    {
      do
      {
        if (!((w)localObject1).e()) {
          break;
        }
        localObject2 = ((w)localObject1).d();
        paramx.a(localObject2, -1);
        ((w)localObject1).f();
        if (j != 0) {
          break label188;
        }
        if (bool) {
          break label181;
        }
      } while (!bool);
    } while (j != 0);
    localObject1 = parambb.l();
    label181:
    label188:
    do
    {
      if (!((w)localObject1).e()) {
        break;
      }
      localObject2 = ((w)localObject1).d();
      paramx.a(localObject2, i);
      if (j != 0) {
        break label499;
      }
      localbb.b(localObject2);
      ((w)localObject1).f();
      if (bool) {
        break label497;
      }
    } while (!bool);
    for (;;)
    {
      if (j == 0) {
        if (!localbb.isEmpty())
        {
          localObject1 = localbb;
          localz.b(localObject1);
          localbb = new bb();
          i++;
          localObject2 = ((bb)localObject1).l();
          do
          {
            if (!((w)localObject2).e()) {
              break;
            }
            e locale1 = ((w)localObject2).d();
            if (bool) {
              break label484;
            }
            w localw;
            switch (paramByte)
            {
            case 1: 
              localw = locale1.p();
              if (j == 0) {
                if (!bool) {
                  break;
                }
              }
              break;
            case 2: 
              localw = locale1.q();
              if (j == 0) {
                if (!bool) {
                  break;
                }
              }
              break;
            case 3: 
              localw = locale1.o();
              if (j == 0) {
                if (!bool) {
                  break;
                }
              }
              break;
            default: 
              localw = locale1.o();
            }
            do
            {
              do
              {
                if (!localw.e()) {
                  break;
                }
                e locale2 = localw.d();
                if (bool) {
                  break label491;
                }
                if (paramx.getInt(locale2) == -1)
                {
                  paramx.a(locale2, i);
                  localbb.b(locale2);
                }
                localw.f();
              } while (!bool);
              ((w)localObject2).f();
            } while (j != 0);
          } while (!bool);
          label484:
          label491:
          if ((j != 0) || (paramInt <= 0) || (paramInt != i)) {
            continue;
          }
        }
      }
    }
    label497:
    label499:
    return (bb[])localz.toArray(new bb[localz.size()]);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.a.b

 * JD-Core Version:    0.7.0.1

 */